import { IRoleAdd, IRoleAddData, IRoleGetData, IRoleMenu, Irole, IroleApiResponse } from "@renderer/interface/role";
import http from "@renderer/utils/request";

// 获取角色列表
export const getRolePageApi = (data?: Irole) => http.get<IroleApiResponse>('/system/role/page', data)
// 获取菜单权限
export const getMenuPageApi = (data: {
	current: string
	size: string
	enabled: string
}) => http.get<IRoleMenu>('/system/menu/page', data)
// 添加角色
export const postRoleAddApi = (data: IRoleAdd) => http.post<IRoleAddData>('/system/role/add', data)
// 删除角色
export const getRoleDeleteApi = (id: string) => http.get<IRoleAddData>('/system/role/delete/' + id)
// 角色详情
export const getRoleGetApi = (id: string) => http.get<IRoleGetData>('/system/role/get/' + id)
// 修改角色
export const postRoleUpdateApi = (data: IRoleAdd) => http.post<IRoleAddData>('/system/role/update', data)